home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update25.zoo / gcc / config / conf_diffs next >
Encoding:
Text File  |  1992-10-09  |  10.6 KB  |  371 lines

  1. *** 1.2    1992/03/27 21:41:42
  2. --- m68k.c    1992/10/09 15:31:45
  3. ***************
  4. *** 56,62 ****
  5.      
  6.   finalize_pic ()
  7.   {
  8. !   if (flag_pic && current_function_uses_pic_offset_table)
  9.       emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
  10.   }
  11.   
  12. --- 56,62 ----
  13.      
  14.   finalize_pic ()
  15.   {
  16. !   if (flag_pic && (flag_pic < 3) && current_function_uses_pic_offset_table)
  17.       emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
  18.   }
  19.   
  20. ***************
  21. *** 204,210 ****
  22.         asm_fprintf (stream, "\tmoveml %0I0x%x,%Rsp@-\n", mask);
  23.   #endif
  24.       }
  25. !   if (flag_pic && current_function_uses_pic_offset_table)
  26.       {
  27.   #ifdef MOTOROLA
  28.         asm_fprintf (stream, "\t%Omove.l %0I__GLOBAL_OFFSET_TABLE_, %s\n",
  29. --- 204,210 ----
  30.         asm_fprintf (stream, "\tmoveml %0I0x%x,%Rsp@-\n", mask);
  31.   #endif
  32.       }
  33. !   if (flag_pic && (flag_pic < 3) && current_function_uses_pic_offset_table)
  34.       {
  35.   #ifdef MOTOROLA
  36.         asm_fprintf (stream, "\t%Omove.l %0I__GLOBAL_OFFSET_TABLE_, %s\n",
  37. ***************
  38. *** 794,805 ****
  39.     /* First handle a simple SYMBOL_REF or LABEL_REF */
  40.     if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF)
  41.       {
  42.         if (reg == 0)
  43.       abort ();
  44.   
  45. !       pic_ref = gen_rtx (MEM, Pmode,
  46. !              gen_rtx (PLUS, Pmode,
  47. !                   pic_offset_table_rtx, orig));
  48.         current_function_uses_pic_offset_table = 1;
  49.         RTX_UNCHANGING_P (pic_ref) = 1;
  50.         emit_move_insn (reg, pic_ref);
  51. --- 794,813 ----
  52.     /* First handle a simple SYMBOL_REF or LABEL_REF */
  53.     if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF)
  54.       {
  55. + #ifdef LEGITIMATE_BASEREL_OPERAND_P
  56. +   if (LEGITIMATE_BASEREL_OPERAND_P (orig))
  57. +     return orig;
  58. + #endif
  59.         if (reg == 0)
  60.       abort ();
  61.   
  62. !       if (flag_pic == 3)
  63. !         pic_ref = gen_rtx (PLUS, Pmode, pic_offset_table_rtx, orig);
  64. !       else
  65. !         pic_ref = gen_rtx (MEM, Pmode,
  66. !                gen_rtx (PLUS, Pmode,
  67. !                     pic_offset_table_rtx, orig));
  68.         current_function_uses_pic_offset_table = 1;
  69.         RTX_UNCHANGING_P (pic_ref) = 1;
  70.         emit_move_insn (reg, pic_ref);
  71. ***************
  72. *** 831,836 ****
  73. --- 839,845 ----
  74.         pic_ref = gen_rtx (PLUS, Pmode, base, orig);
  75.         /* Likewise, should we set special REG_NOTEs here?  */
  76.       }
  77.     return pic_ref;
  78.   }
  79.   
  80. ***************
  81. *** 1593,1598 ****
  82. --- 1602,1610 ----
  83.         output_address (XEXP (op, 0));
  84.         if (letter == 'd' && ! TARGET_68020
  85.         && CONSTANT_ADDRESS_P (XEXP (op, 0))
  86. +       && !(TARGET_PC_REL && GET_CODE (XEXP (op, 0)) == SYMBOL_REF
  87. +            && SYMBOL_REF_FLAG (XEXP (op, 0))
  88. +            && !SYMBOL_REF_USED (XEXP (op, 0)))
  89.         && !(GET_CODE (XEXP (op, 0)) == CONST_INT
  90.              && INTVAL (XEXP (op, 0)) < 0x8000
  91.              && INTVAL (XEXP (op, 0)) >= -0x8000))
  92. ***************
  93. *** 1883,1888 ****
  94. --- 1895,1902 ----
  95.                 fprintf (file, ":w");
  96.               if ((flag_pic == 2) && (breg == pic_offset_table_rtx))
  97.                 fprintf (file, ":l");
  98. +             if ((flag_pic == 3) && (breg == pic_offset_table_rtx))
  99. +               fprintf (file, ":W");
  100.             }
  101.           fprintf (file, "(%s", reg_names[REGNO (breg)]);
  102.           if (ireg != 0)
  103. ***************
  104. *** 1898,1903 ****
  105. --- 1912,1919 ----
  106.                 fprintf (file, ":w");
  107.               if ((flag_pic == 2) && (breg == pic_offset_table_rtx))
  108.                 fprintf (file, ":l");
  109. +             if ((flag_pic == 3) && (breg == pic_offset_table_rtx))
  110. +               fprintf (file, ":W");
  111.             }
  112.           if (addr != 0 && ireg != 0)
  113.             {
  114. ***************
  115. *** 1975,1980 ****
  116. --- 1991,2009 ----
  117.           fprintf (file, "%d:w", INTVAL (addr));
  118.   #endif
  119.         }
  120. +     else if (TARGET_PC_REL && GET_CODE (addr) == SYMBOL_REF
  121. +          && SYMBOL_REF_FLAG (addr)
  122. +          && !SYMBOL_REF_USED (addr))
  123. +       {
  124. + #ifdef MOTOROLA
  125. +         output_addr_const (file, addr);
  126. +         fputs ("(pc)", file);
  127. + #else
  128. +         fputs ("pc@(", file);
  129. +         output_addr_const (file, addr);
  130. +         putc (')', file);
  131. + #endif
  132. +       }
  133.       else
  134.         {
  135.           output_addr_const (file, addr);
  136. ***************
  137. *** 1982,1984 ****
  138. --- 2011,2028 ----
  139.       break;
  140.       }
  141.   }
  142. + #ifdef ENCODE_SECTION_INFO
  143. + /* Does operand (which is a symbolic_operand) live in text space? If
  144. +    so SYMBOL_REF_FLAG, which is set by ENCODE_SECTION_INFO, will be true.*/
  145. + int
  146. + read_only_operand (operand)
  147. +      rtx operand;
  148. + {
  149. +   if (GET_CODE (operand) == CONST)
  150. +     operand = XEXP (XEXP (operand, 0), 0);
  151. +   if (GET_CODE (operand) == SYMBOL_REF)
  152. +     return SYMBOL_REF_FLAG (operand) || CONSTANT_POOL_ADDRESS_P (operand);
  153. +   return 1;
  154. + }
  155. + #endif
  156. *** 1.3    1992/06/11 23:35:03
  157. --- m68k.h    1992/10/09 15:31:46
  158. ***************
  159. *** 91,96 ****
  160. --- 91,102 ----
  161.   /* Support 68040 fp instructions.  */
  162.   #define TARGET_68040_ONLY (target_flags & 01000)
  163.   
  164. + /* Use PC-relative addressing for refs to read-only data */
  165. + #define TARGET_PC_REL (target_flags & 02000)
  166. + /* Use base-relative addressing for refs to data&bss segments */
  167. + #define TARGET_BASE_REL (target_flags & 04000)
  168.   /* Macro to define tables used to set the flags.
  169.      This is a list in braces of pairs in braces,
  170.      each pair being { "NAME", VALUE }
  171. ***************
  172. *** 118,123 ****
  173. --- 124,133 ----
  174.       { "68030", -01400},                \
  175.       { "68030", 7},                \
  176.       { "68040-only", 01000},            \
  177. +     { "pcrel", 02000},                \
  178. +     { "nopcrel", -02000},            \
  179. +     { "baserel", 04000},            \
  180. +     { "nobaserel", -04000},            \
  181.       { "", TARGET_DEFAULT}}
  182.   /* TARGET_DEFAULT is defined in sun*.h and isi.h, etc.  */
  183.   
  184. ***************
  185. *** 129,134 ****
  186. --- 139,145 ----
  187.     if (TARGET_FPA) target_flags &= ~2;    \
  188.     if (! TARGET_68020 && flag_pic == 2)    \
  189.       error("-fPIC is not currently supported on the 68000 or 68010\n");    \
  190. +   if (TARGET_BASE_REL) flag_pic = 3;    \
  191.   }
  192.   #else
  193.   #define OVERRIDE_OPTIONS        \
  194. ***************
  195. *** 135,140 ****
  196. --- 146,152 ----
  197.   {                    \
  198.     if (! TARGET_68020 && flag_pic == 2)    \
  199.       error("-fPIC is not currently supported on the 68000 or 68010\n");    \
  200. +   if (TARGET_BASE_REL) flag_pic = 3;    \
  201.   }
  202.   #endif /* defined SUPPORT_SUN_FPA */
  203.   
  204. ***************
  205. *** 326,334 ****
  206.   #ifndef SUPPORT_SUN_FPA
  207.   
  208.   #define CONDITIONAL_REGISTER_USAGE \
  209. ! {                                               \
  210. !   if (flag_pic)                                 \
  211. !     fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;    \
  212.   }
  213.   
  214.   #else /* defined SUPPORT_SUN_FPA */
  215. --- 338,349 ----
  216.   #ifndef SUPPORT_SUN_FPA
  217.   
  218.   #define CONDITIONAL_REGISTER_USAGE \
  219. ! {                                                \
  220. !   if (flag_pic)                                  \
  221. !     fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;     \
  222. !   /* prevent saving/restoring of the base reg */ \
  223. !   if (flag_pic == 3)                 \
  224. !     call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
  225.   }
  226.   
  227.   #else /* defined SUPPORT_SUN_FPA */
  228. *** 1.3    1992/06/11 23:35:03
  229. --- m68k.md    1992/10/09 15:31:46
  230. ***************
  231. *** 704,716 ****
  232.   {
  233.     if (flag_pic && symbolic_operand (operands[1], SImode)) 
  234.       {
  235. !       /* The source is an address which requires PIC relocation.  
  236. !          Call legitimize_pic_address with the source, mode, and a relocation
  237. !          register (a new pseudo, or the final destination if reload_in_progress
  238. !          is set).   Then fall through normally */
  239. !       extern rtx legitimize_pic_address();
  240. !       rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
  241. !       operands[1] = legitimize_pic_address (operands[1], SImode, temp);
  242.       }
  243.   }")
  244.   
  245. --- 704,721 ----
  246.   {
  247.     if (flag_pic && symbolic_operand (operands[1], SImode)) 
  248.       {
  249. ! #ifdef LEGITIMATE_BASEREL_OPERAND_P
  250. !       if (flag_pic != 3 || !LEGITIMATE_BASEREL_OPERAND_P (operands[1]))
  251. ! #endif
  252. !       {
  253. !         /* The source is an address which requires PIC relocation.  
  254. !            Call legitimize_pic_address with the source, mode, and a relocation
  255. !            register (a new pseudo, or the final destination if reload_in_progress
  256. !            is set).   Then fall through normally */
  257. !         extern rtx legitimize_pic_address();
  258. !         rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
  259. !         operands[1] = legitimize_pic_address (operands[1], SImode, temp);
  260. !       }
  261.       }
  262.   }")
  263.   
  264. ***************
  265. *** 4644,4650 ****
  266.     ""
  267.     "
  268.   {
  269. !   if (flag_pic && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
  270.       operands[0] = gen_rtx (MEM, GET_MODE (operands[0]),
  271.                  force_reg (Pmode, XEXP (operands[0], 0)));
  272.   }")
  273. --- 4649,4655 ----
  274.     ""
  275.     "
  276.   {
  277. !   if (flag_pic && flag_pic < 3 && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
  278.       operands[0] = gen_rtx (MEM, GET_MODE (operands[0]),
  279.                  force_reg (Pmode, XEXP (operands[0], 0)));
  280.   }")
  281. ***************
  282. *** 4655,4661 ****
  283.        (match_operand:SI 1 "general_operand" "g"))]
  284.     ;; Operand 1 not really used on the m68000.
  285.   
  286. !   "! flag_pic"
  287.     "*
  288.   #ifdef MOTOROLA
  289.     return \"jsr %0\";
  290. --- 4660,4666 ----
  291.        (match_operand:SI 1 "general_operand" "g"))]
  292.     ;; Operand 1 not really used on the m68000.
  293.   
  294. !   "(! flag_pic || flag_pic == 3)"
  295.     "*
  296.   #ifdef MOTOROLA
  297.     return \"jsr %0\";
  298. ***************
  299. *** 4670,4676 ****
  300.        (match_operand:SI 1 "general_operand" "g"))]
  301.     ;; Operand 1 not really used on the m68000.
  302.   
  303. !   "flag_pic"
  304.     "*
  305.     return \"jsr %0\";
  306.   ")
  307. --- 4675,4681 ----
  308.        (match_operand:SI 1 "general_operand" "g"))]
  309.     ;; Operand 1 not really used on the m68000.
  310.   
  311. !   "(flag_pic && flag_pic < 3)"
  312.     "*
  313.     return \"jsr %0\";
  314.   ")
  315. ***************
  316. *** 4686,4692 ****
  317.     ""
  318.     "
  319.   {
  320. !   if (flag_pic && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
  321.       operands[1] = gen_rtx (MEM, GET_MODE (operands[1]),
  322.                  force_reg (Pmode, XEXP (operands[1], 0)));
  323.   }")
  324. --- 4691,4697 ----
  325.     ""
  326.     "
  327.   {
  328. !   if (flag_pic && flag_pic < 3 && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
  329.       operands[1] = gen_rtx (MEM, GET_MODE (operands[1]),
  330.                  force_reg (Pmode, XEXP (operands[1], 0)));
  331.   }")
  332. ***************
  333. *** 4697,4703 ****
  334.       (call (match_operand:QI 1 "memory_operand" "o")
  335.             (match_operand:SI 2 "general_operand" "g")))]
  336.     ;; Operand 2 not really used on the m68000.
  337. !   "! flag_pic"
  338.     "*
  339.   #ifdef MOTOROLA
  340.     return \"jsr %1\";
  341. --- 4702,4708 ----
  342.       (call (match_operand:QI 1 "memory_operand" "o")
  343.             (match_operand:SI 2 "general_operand" "g")))]
  344.     ;; Operand 2 not really used on the m68000.
  345. !   "(! flag_pic || flag_pic == 3)"
  346.     "*
  347.   #ifdef MOTOROLA
  348.     return \"jsr %1\";
  349. ***************
  350. *** 4712,4718 ****
  351.       (call (match_operand:QI 1 "memory_operand" "o")
  352.             (match_operand:SI 2 "general_operand" "g")))]
  353.     ;; Operand 2 not really used on the m68000.
  354. !   "flag_pic"
  355.     "*
  356.     return \"jsr %1\";
  357.   ")
  358. --- 4717,4723 ----
  359.       (call (match_operand:QI 1 "memory_operand" "o")
  360.             (match_operand:SI 2 "general_operand" "g")))]
  361.     ;; Operand 2 not really used on the m68000.
  362. !   "(flag_pic && flag_pic < 3)"
  363.     "*
  364.     return \"jsr %1\";
  365.   ")
  366.